import http from "@/utils/fetch";

/**
 * 账单结算
 */
// 结算审核列表
export function auditSettleList(params) {
  return http.post("/Admin/FinanceCheck/orderLeaseSettleList", params);
}
// 推广平台结算审核列表
export function settleList(params) {
  return http.post("/Admin/Amount/settleList", params);
}
// 推广平台 点击结算
export function checkOrderSettle(id) {
  return http.post("/Admin/Amount/orderSettle", { lease_id: id });
}
// 推广平台 拒绝结算
export function refuseOrderSettle(id) {
  return http.post("/Admin/Amount/refuseOrderSettle", { lease_id: id });
}
// 推广平台 一次性结算列表
export function settleListOnce(params) {
  return http.post("/Admin/Amount/settleListOnce",params);
}

// 推广平台 点击结算-一次性
export function orderSettleOnce(params) {
  return http.post("/Admin/Amount/orderSettleOnce", params);
}
// 推广平台 拒绝结算-一次性
export function refuseOrderSettleOnce(id) {
  return http.post("/Admin/Amount/refuseOrderSettleOnce", { order_id: id });
}
// 推广平台 结算详情
export function checkSettleData(id) {
  return http.get("/Admin/Amount/getSettleData", { lease_id: id });
}
// 获取结算详情
export function getSettleData(id) {
  return http.get("/Admin/FinanceCheck/getSettleData", { lease_id: id });
}
// 拒绝结算
export function orderRefuseSettle(params) {
  return http.post("/Admin/FinanceCheck/orderRefuseSettle", params, true);
}
// 还款报送
export function setCreditsData3(params) {
  return http.post("/Admin/Order/setCreditsData3", params, true);
}
// 代偿报送
export function setCreditsData4(params) {
  return http.post("/Admin/Order/setCreditsData4", params, true);
}
// 追偿报送
export function setCreditsData5(params) {
  return http.post("/Admin/Order/setCreditsData5", params, true);
}
// 撤销拒绝结算
export function cancelRefuseSettle(id) {
  return http.post(
    "/Admin/FinanceCheck/cancelRefuseSettle",
    { lease_id: id },
    true
  );
}
// 账单结算--单期结算
export function orderSettle(id) {
  return http.post("/Admin/FinanceCheck/orderSettle", { lease_id: id }, true);
}

/**
 * 花呗账单
 */
// 花呗订单结算列表
export function huebeiSettleList(params) {
  return http.post("/Admin/FinanceCheck/huebeiOrderSettleList", params);
}
// 获取花呗结算详情
export function getHuabeiSettleData(id) {
  return http.get("/Admin/FinanceCheck/getHuabeiOrderSettleData", {
    order_id: id,
  });
}
// 花呗订单结算
export function huabeiOrderSettle(id) {
  return http.post(
    "/Admin/FinanceCheck/huabeiOrderSettle",
    { order_id: id },
    true
  );
}
// 花呗订单拒绝结算
export function huabeiRefuseSettle(params) {
  return http.post("/Admin/FinanceCheck/huabeiOrderRefuseSettle", params, true);
}
// 花呗订单撤销拒绝结算
export function huabeiCancelRefuseSettle(id) {
  return http.post(
    "/Admin/FinanceCheck/huabeiCancelRefuseSettle",
    { order_id: id },
    true
  );
}

// 订单退款审核列表
export function orderRefundCheckList(params) {
  return http.post("/Admin/FinanceCheck/orderRefundCheckList", params);
}

// 筛选获取所有订单状态
export function getOrderStatus() {
  return http.post("/Admin/Finance/getOrderStatus");
}
// 财务订单列表
export function financeOrderList(params) {
  return http.post("/Admin/Finance/financeOrderList", params);
}
// 财务逾期列表
export function financeOverdueList(params) {
  return http.post("/Admin/Finance/financeOverdueList", params);
}
// 发送逾期短信
export function sendOverdueUser(params) {
  return http.post("/Admin/Finance/sendOverdueUser", params);
}
// 提现记录
export function withdrawalList(params) {
  return http.post("/Admin/Withdrawal/withdrawalList", params);
}
// 财务对账流水
export function reconciliationFlow(params) {
  return http.post("/Admin/Finance/reconciliationFlow", params);
}
// 获取手续费率和手续费详情
export function getFeeDetails(params) {
  return http.post("/Admin/Finance/getFeeDetails", params);
}
// 账单财务列表
export function financeLeaseList(params) {
  return http.post("/Admin/Finance/financeLeaseList", params);
}
// 获取记录流水
export function getLeaseFlow(params) {
  return http.post("/Admin/Finance/getLeaseFlow", params);
}
// 财务订单导出
export function orderListExport(params) {
  return http.export("/Admin/Finance/orderListExport", params, "订单财务列表");
}
// 财务租期列表导出
export function leaseListExport(params) {
  return http.export("/Admin/Finance/leaseListExport", params, "账单财务列表");
}
// 财务逾期列表导出
export function overdueListExport(params) {
  return http.export("/Admin/Finance/overdueListExport", params, "逾期列表");
}
// 财务对账流水导出
export function reconciliationExport(params) {
  return http.export("/Admin/Finance/reconciliationExport", params, "对账流水");
}
// 手动代扣
export function manualWithholding(params) {
  return http.post("/Admin/Finance/manualWithholding", params, true);
}
// 逾期列表-客服备注记录
export function getOrderRemark(params) {
  return http.post("/Admin/Finance/getOrderRemark", params);
}
// 逾期列表-短信发送记录
export function getOverdueSmsLog(trade_no) {
  return http.post("/Admin/Finance/getOverdueSmsLog", { trade_no });
}
// 逾期列表-逾期短信批量发送
export function sendOverdueSms(leaseId) {
  return http.post("/Admin/Finance/sendOverdueSms", { leaseId });
}
// 添加客服备注
export function setOrderRemark(params) {
  return http.post("/Admin/Finance/setOrderRemark", params, true);
}
// 查看扣款记录
export function leaseWithholdLog(params) {
  return http.post("/Admin/Finance/leaseWithholdLog", params);
}
// 提现记录导出
export function withdrawalListExport(params) {
  return http.export(
    "/Admin/Withdrawal/withdrawalListExport",
    params,
    "提现记录"
  );
}
// 花呗财务账单列表
export function financeHuaBeiList(params) {
  return http.post("/Admin/Finance/financeHuaBeiList", params);
}
// 花呗财务账单列表-导出
export function huaBeiListExport(params) {
  return http.export(
    "/Admin/Finance/huaBeiListExport",
    params,
    "花呗财务账单列表"
  );
}
// 设备分期列表
export function financeEquipmentList(params) {
  return http.post("/Admin/Finance/financeEquipmentList", params);
}
// 设备分期列表-导出
export function equipmentListExport(params) {
  return http.export(
    "/Admin/Finance/equipmentListExport",
    params,
    "设备分期列表"
  );
}
// 回款列表
export function financeCollectionList(params) {
  return http.post("/Admin/Finance/financeCollectionList", params);
}
// 回款列表-导出
export function collectionListExport(params) {
  return http.export("/Admin/Finance/collectionListExport", params, "回款列表");
}
// 账单结算列表导出
export function orderLeaseSettleExport(params) {
  return http.export(
    "/Admin/FinanceCheck/orderLeaseSettleExport",
    params,
    "账单结算列表"
  );
}
// 花呗订单结算列表导出
export function huebeiExport(params) {
  return http.export(
    "/Admin/FinanceCheck/huebeiOrderSettleExport",
    params,
    "花呗订单结算列表"
  );
}
// 自动代扣开关操作
export function withholdSwitch(params) {
  return http.post("/Admin/Finance/withholdSwitch", params, true);
}
// 获取修改账单为线下支付订单信息
export function getOfflinePayData(oId, lId) {
  return http.get("/Admin/Finance/getOfflinePayData", { order_id: oId, lease_id: lId });
}
// 线下支付发送验证码
export function offlinePaySendCode(oId, lId) {
  return http.post("/Admin/Finance/offlinePaySendCode", { order_id: oId, lease_id: lId }, true);
}
// 修改账单为线下支付
export function setOfflinePay(params) {
  return http.post("/Admin/Finance/setOfflinePay", params, true);
}
// 获取订单操作记录
export function getOrderLog(params) {
  return http.get("/Admin/Finance/getOrderLog", params);
}

// 获取自营账户
export function myAccount(params) {
  return http.post("/Admin/Supplier/myAccount");
}

// 获取自营账户
export function selfWithdrawalList(params) {
  return http.post("/Admin/Supplier/withdrawalList", params);
}

// 申请转账
export function transApply(params) {
  return http.post("/Admin/Withdrawal/transApply", params);
}

// 取消转账
export function transRefuse(params) {
  return http.post("/Admin/Withdrawal/transRefuse", params);
}

// 申请通过
export function transPass(id) {
  return http.post("/Admin/Withdrawal/transPass", {id:id});
}

// 转账列表
export function transList(params) {
  return http.post("/Admin/Withdrawal/transList", params);
}
